package com.jyu.apts.dto;

import com.jyu.apts.entity.ItemBatchRecord;
import com.jyu.apts.entityEnum.ItemBatchRecordStatusEnum;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ItemBatchRecordDto {
	long id;//主键
	long count;//数量
	ItemProductionLineDto itemProductionLine;
	Integer status;
	String statusName;
	public ItemBatchRecordDto convert(ItemBatchRecord itemBatchRecord) {
		setId(itemBatchRecord.getId());
		setItemProductionLine(new ItemProductionLineDto().convert(itemBatchRecord.getItemProductionLine()));
		setCount(itemBatchRecord.getCount());
		setStatus(itemBatchRecord.getStatus());
		setStatusName(ItemBatchRecordStatusEnum.values()[itemBatchRecord.getStatus()].getName());
		return this;
	}
	
}
